from selenium.webdriver.common.by import By


class  AdminBillAdjustmentLocator:

    # adjustment_menu
    adjustment_tab = (By.CSS_SELECTOR, '[path="/console/adjust"]')

    income_expense_tab = (By.CSS_SELECTOR, '[path="/console/incomeExpense"]')
    user_income_expense_tab = (By.CSS_SELECTOR, '[path="/work_bench/userCenter/fundManagement/incomeExpense"]')


    account_email = (By.ID,'accountEmail')

    adjust_amount = (By.ID,'adjustAmount')

    remark = (By.ID,'remark')

    submit_button = (By.XPATH, '(//button[contains(@class,"antd4-btn-primary")])[1]')

    balance_amount_before_adjust = (By.XPATH,'(//span[contains(@class,"amount")])[1]')
    adjust_amount_result = (By.XPATH,'(//span[contains(@class,"amount")])[2]')
    balance_amount_after_adjust = (By.XPATH,'(//span[contains(@class,"amount")])[3]')

    search_email = (By.ID,'searchForm_email')

    search_transation_type = (By.XPATH,'(//div[contains(@class,"antd4-select-show-arrow")])[2]')
    user_search_transation_type = (By.XPATH,'(//div[contains(@class,"antd4-select-show-arrow")])[1]')

    def get_email_value_locator(self,email):
        search_email_value = (By.CSS_SELECTOR, '[title="'+email+'"]')
        return search_email_value

    def get_transation_value_locator(self,type):
        transation_value = (By.CSS_SELECTOR, '[title="'+type+'"]')
        return transation_value

    last_income_record_journal_number = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[7]')
    last_income_record_incmoe = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[6]')
    last_income_record_tran_channel = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[5]')
    last_income_record_anount = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[4]/div/div/span')
    last_income_record_amount_user = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[4]/span')
    last_income_record_type = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[3]')
    last_income_record_timestamp = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[2]')
    last_income_record_account = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[1]')
    last_income_record_no = (By.XPATH, '(//a[contains(@class,"linkDetail")])[1]')
    last_income_record_income_expense = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[6]')

    back_button = (By.XPATH, '(//button[contains(@class,"antd4-btn-primary")])[1]')

    adjust_fail = (By.XPATH,'//div[contains(@class,"antd4-result-title")]/div')

    search_time = (By.XPATH,'//div[contains(@class,"antd4-picker-input")]')

    pre_button = (By.XPATH,'//button[contains(@class,"antd4-picker-header-prev-btn")]')

    next_button = (By.XPATH, '(//button[contains(@class,"antd4-picker-header-next-btn")])[2]')

    date1 = (By.XPATH, '(//div[contains(@class,"antd4-picker-cell-inner")])[15]')

    date2 = (By.XPATH, '(//div[contains(@class,"antd4-picker-cell-inner")])[65]')

    detail_transaction_no = (By.XPATH, '(//span[contains(@class,"antd4-descriptions-item-content")])[1]')
    detail_account_email = (By.XPATH, '(//span[contains(@class,"antd4-descriptions-item-content")])[2]')
    detail_timestamp = (By.XPATH, '(//span[contains(@class,"antd4-descriptions-item-content")])[3]')
    detail_amount = (By.XPATH, '(//span[contains(@class,"antd4-descriptions-item-content")])[4]/span')
    detail_income_expense = (By.XPATH, '(//span[contains(@class,"antd4-descriptions-item-content")])[5]')
    detail_tran_type = (By.XPATH, '(//span[contains(@class,"antd4-descriptions-item-content")])[6]')
    detail_tran_channel = (By.XPATH, '(//span[contains(@class,"antd4-descriptions-item-content")])[7]')
    detail_journal_number = (By.XPATH, '(//span[contains(@class,"antd4-descriptions-item-content")])[8]')

    income_expense_filter = (By.XPATH, '(//span[contains(@class,"antd4-table-filter-trigger")])[1]')

    income_item = (By.XPATH, '(//li[contains(@class,"antd4-dropdown-menu-item")])[1]')

    income_expense_filter_ok_button = (By.XPATH, '(//button[contains(@class,"antd4-btn-primary")])[1]')

    # my Amount Adjustment页面菜单列表
    my_amount_adjustment_list = (By.CSS_SELECTOR, '[class="antd4-tabs-tab-btn"]')
    #点击batch operation
    #click_batch_operation = (By.XPATH, '//*[@id="rc-tabs-1-tab-2"]')
    click_batch_operation = (By.CSS_SELECTOR, '#rc-tabs-1-tab-2')
    #是否有请下载的提示语
    if_please_download = (By.CSS_SELECTOR, '[class="antd4-alert-message"]')

    #是否有operation id
    if_operation_id = (By.XPATH, '//*[@id="value"]')
    #是否有搜索框
    if_search = (By.XPATH, '(//button[@class="antd4-btn antd4-btn-primary"])[2]')
    #是否有operation list
    if_operation_list = (By.CSS_SELECTOR, '[class="antd4-table-cell"]')

    # Amount Adjustment页面标题
    amount_adjustment_title =  (By.XPATH, '//div[@class="antd4-space-item"]/div[text()="Amount Adjustment"]')
    # Single Operation页签
    single_operation_page =  (By.XPATH, '//div[text()="Single Operation"]')
    # Batch Operation页签
    batch_operation_page =  (By.XPATH, '//div[text()="Batch Operation"]')
    # 模板下载按钮
    batch_operation_download_button =  (By.XPATH, '//a[text()="Download Template"]')
    # operation Id
    batch_operation_id = (By.XPATH, '(//div[@class="cre-table-nowrap"])[1]')
    # operation下拉框
    batch_operation_dropdown_box = (By.XPATH, '(//*[@class="antd4-select-selector"])[1]')
    # operator选项
    batch_operation_operator = (By.XPATH, '//*[@title="Operator" and @aria-selected="false"]')
    # 下拉框值
    batch_operation_value = (By.XPATH, '//span[@class="antd4-select-selection-item"]')
    # search 按钮
    batch_operation_search = (By.XPATH, '//span[text()="Search"]')
    # reset 按钮
    batch_operation_reset = (By.XPATH, '//button[@class="antd4-btn antd4-btn-default"]')
    # 翻页下拉框
    batch_operation_page_switching_button = (By.XPATH, '(//span[@class="antd4-select-selection-item"])[2]')
    # 翻页下拉框值
    batch_operation_page_switching_button_value = (By.XPATH, '(//span[@class="antd4-select-selection-item"])[2]')
    # 翻页20
    batch_operation_page_switching_button_15 = (By.XPATH, '//div[text()="15 / page"]')
    # 总数量
    batch_operation_total_item = (By.XPATH, '//li[@class="antd4-pagination-total-text"]')
    # 下一页按钮
    batch_operation_next_page = (By.XPATH, '//span[@class="anticon anticon-right"]')
    # # 展示行数
    # batch_operation_page_size = (By.XPATH, '//a[@rel="nofollow"]')
    # batch第一条数据000001
    batch_operation_id_0000001 =  (By.XPATH, '//div[text()="0000001"]')
    # batch无数据
    batch_operation_no_data =  (By.XPATH, '//div[text()="No Data"]')
    # batch operator
    batch_operation_operator_data =  (By.XPATH, '(//td[@class="antd4-table-cell"]/div[text()="lwm528675013@163.com"])[1]')
    # operation id输入框
    operation_id_input_field =  (By.XPATH, '//input[@class="antd4-input"]')
    # upload file
    operation_id_upload_file =  (By.XPATH, '//input[@type="file"]')
    # upload success
    operation_id_upload_file_tips =  (By.XPATH, '//div[@class="alertModal___3_BwD"]//div[@class="antd4-alert-message"]')
    # upload success提示语
    operation_id_upload_file_tips_value =  (By.XPATH, '//div[@class="antd4-alert-description"]')
    # 列表最新的operation id
    batch_operation_operation_id_new =  (By.XPATH, '(//td[@class="antd4-table-cell"])[1]')
    # 列表最新的operator
    batch_operation_operator_new =  (By.XPATH, '(//td[@class="antd4-table-cell"])[2]')
    # 列表最新的operation time
    batch_operation_operation_time_new =  (By.XPATH, '(//td[@class="antd4-table-cell"])[3]')
    # 列表最新的operation status
    batch_operation_operation_status_new =  (By.XPATH, '(//td[@class="antd4-table-cell"])[4]')
    # 列表最新的actions
    batch_operation_actions_new =  (By.XPATH, '(//*[text()="Result File"])[1]')
    # 上传失败框
    batch_operation_upload_fail_prompt_box =  (By.XPATH, '//div[@class="antd4-message-notice-content"]')
    # 上传成功确认框
    upload_success_confirmation_box =  (By.XPATH, '//span[@class="anticon anticon-close"]')
    # 处理结果模板
    processing_result_template =  (By.XPATH, '(//*[text()="Result File"])[1]')

    # 初始页面展开的tab
    default_page_expanded = (By.CSS_SELECTOR, '[aria-expanded="true"]')
    # dashboard按钮
    dashboard_title_btn = (By.CSS_SELECTOR, '[path="/work_bench/dashboard"]')
    # dashboard页面
    dashboard_page = (By.XPATH, '//div[@class="cre-page-container-default-content"]')
    # available balance值
    available_balance_value = (By.XPATH, '//span[@class="antd4-typography antd4-typography-ellipsis antd4-typography-single-line antd4-typography-ellipsis-single-line money___SvzPg"]')





